package com.onepiece.metrics;

import java.util.Map;
import java.util.concurrent.TimeUnit;
import java.util.function.Supplier;

/**
 * @author guoyanjiang
 * @date 2019-05-08
 */
public interface MetricsService {

    void increment(String metric, Map<String, String> tags, double amount);

    void increment(CustomMetricsEnum metricsEnum, Map<String, String> tags);

    void increment(CustomMetricsEnum metricsEnum, String... tags);

    <T> T record(CustomMetricsEnum metricsEnum, Supplier<T> f, Map<String, String> tags);

    <T> T record(CustomMetricsEnum metricsEnum, Supplier<T> f, String... tags);

    void record(CustomMetricsEnum metricsEnum, Runnable f, Map<String, String> tags);

    void record(CustomMetricsEnum metricsEnum, Runnable f, String... tags);

    void record(String metric, long timeAmount, TimeUnit timeUnit, Map<String, String> tags);

    void record(CustomMetricsEnum metricsEnum, long timeAmount, TimeUnit timeUnit, Map<String, String> tags);

    void record(CustomMetricsEnum metricsEnum, long timeAmount, TimeUnit timeUnit, String... tags);

    void gauge(String metric, double num, String... tags);

    void gauge(String metric, double num, Map<String, String> tags);

    void gauge(CustomMetricsEnum metricsEnum, double num, Map<String, String> tags);

    void gauge(CustomMetricsEnum metricsEnum, double num, String... tags);
}
